package cn.enjoy.design.structure.proxy.listener.customer;

import cn.enjoy.design.structure.proxy.Enums.FlowTypeEnum;
import cn.enjoy.design.structure.proxy.event.FlowEvent;
import cn.enjoy.design.structure.proxy.event.base.BaseSubmitEvent;
import cn.enjoy.design.structure.proxy.listener.FlowStateListener;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * @author K
 * @date 2021-07-18 18:34
 */
@Service
@AllArgsConstructor
@Slf4j
public class CustomerFlowFormListener implements FlowStateListener<FlowEvent> {

    @Override
    public void handler(FlowEvent flowEvent) {
        if (flowEvent.getType() == FlowTypeEnum.CUSTOMER) {
            if (flowEvent instanceof BaseSubmitEvent) {
            }
//        else if (flowEvent instanceof BaseHandledEvent) {
//            insertLog(((BaseHandledEvent) event).getFlowFormId(), "已处理");
//        } else if (flowEvent instanceof BaseAcceptorEvent) {
//            insertLog(((BaseAcceptorEvent) event).getFlowFormId(), "受理中");
//        } else if (flowEvent instanceof BaseCloseEvent) {
//            insertLog(((BaseCloseEvent) event).getFlowFormId(), "完成");
//        }
        } else {
            System.out.println("无法通过");
        }
    }

}
